/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package rmsbean;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

/**
 *
 * @author luis
 */
public class UsuarioBean {

    private int cod;
    private String login, senha;

    public byte[] getBytes() throws IOException {
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(baos);
        dos.writeUTF(login);
        dos.writeUTF(senha);
        byte[] ret = baos.toByteArray();
        dos.close();
        baos.close();
        return ret;
    }

    public void setBytes(byte[] valores) throws IOException {
        ByteArrayInputStream bais = new ByteArrayInputStream(valores);
        DataInputStream dis = new DataInputStream(bais);
        this.login = dis.readUTF();
        this.senha = dis.readUTF();
        dis.close();
        bais.close();
    }

    public int getCod() {
        return cod;
    }

    public void setCod(int cod) {
        this.cod = cod;
    }

    

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getSenha() {
        return senha;
    }

    public void setSenha(String senha) {
        this.senha = senha;
    }
    
}